package br.net.woodstock.tickettoride.web.seam.access;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.core.Conversation;

import br.net.woodstock.tickettoride.api.access.UserService;
import br.net.woodstock.tickettoride.web.jsf.access.common.AbstractUserBean;

@Name("userBean")
@Scope(ScopeType.CONVERSATION)
public class UserBean extends AbstractUserBean {

	private static final long	serialVersionUID	= 1L;

	@In("#{userService}")
	private UserService			userService;

	@In
	private Conversation		conversation;

	@Override
	public UserService getUserService() {
		return this.userService;
	}

	@Override
	protected void onStart() {
		this.conversation.begin();
	}

	@Override
	protected void onEnd() {
		this.conversation.end(true);
	}

}
